<template>
  <div class="loginpanel">
    <el-tabs type="border-card" stretch v-model="currentTab">
      <el-tab-pane name="account">
        <template #label>
          <span> <i class="el-icon-user"></i> 账号登录 </span>
        </template>
        <logininput ref="accountRef" />
      </el-tab-pane>
      <el-tab-pane name="phone">
        <template #label>
          <span> <i class="el-icon-phone"></i> 手机登录 </span>
        </template>
        <loginphone ref="phoneRef" />
      </el-tab-pane>
    </el-tabs>
    <div class="account-control">
      <el-checkbox v-model="ispassword">记住密码</el-checkbox>
      <el-button
        type="warning"
        size="mini"
        class="login-btn"
        @click="loginButton"
        >请开始你的表演</el-button
      >
      <el-link>忘记密码</el-link>
    </div>
  </div>
</template>
<script lang="ts" setup>
import logininput from './logininput.vue'
import loginphone from './loginphone.vue'
import { ref } from 'vue'
const currentTab = ref('account')
const ispassword = ref(true)
const accountRef = ref<InstanceType<typeof logininput>>()
const phoneRef = ref<InstanceType<typeof loginphone>>()
const loginButton = () => {
  if (currentTab.value === 'account') {
    accountRef.value?.loginAcction(ispassword.value)
  } else {
    phoneRef.value?.loginAcction(ispassword.value)
  }
}
</script>
<style lang="less" scoped>
.loginpanel {
  justify-content: center;
  text-align: center;
  width: 350px;
}

.login-btn {
  width: 45%;
  background-color: rgba(orange, 0.2, 0.5, 0.5);
}
.el-tabs--border-card {
  background-color: rgba(0, 0, 0, 0.15);
  box-shadow: 0 0 10px 2px rgb(241, 191, 97);
  background: none;
  border: none;
  margin-top: -16.1px;
}
.el-tabs--border-card {
  /deep/ .el-tabs__header {
    background-color: rgba(0, 0, 0, 0.15);
    box-shadow: 0 0 10px 2px rgb(241, 191, 97);
  }
}

.loginpanel {
  position: fixed;
  top: 35%;
}

.account-control {
  margin-top: 10px;
  margin-left: 6px;
  margin-right: 6px;
  margin-bottom: 5px;
  display: flex;
  justify-content: space-between;
}

.loginpanel {
  border-radius: 8px;
  box-shadow: 0 0 10px 2px rgb(241, 191, 97);
  color: #fff;
  font-weight: lighter;
  overflow: hidden;
}
.loginpanel::before {
  content: '';
  z-index: -1;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  margin: -20px;
  filter: blur(20px);
}
</style>
